<?php
namespace Club\Controller;
use Think\Controller;
class IndexController extends PublicController {
    /*登录页  开发人：周弈男*/
    public function index(){
    	$this->display();
    }
    /*登陆  开发人：周弈男*/
    public function login(){
       session('flag',null);
       $clubadmin=M('clubadmin');
       $map = array();
       $map['nick'] = I('post.adminname');
       $map['pwd'] = md5(I('post.pwd'));

       $res=$clubadmin->where($map)->find();
       if($res==null){
          $this->error('用户名密码错误');
       }else{
          session("flag","no");
          $_SESSION['club']=$res['club'];
          redirect(U("Club/editclub"));
       }
    }
}
